package com.dhl.facade;

/**
 * @title: HomeTherterFacade
 * @Author danghailiang
 * @Date: 2022/8/10 8:01
 * @Version 1.0
 */
public class HomeTheaterFacade {
    // dvd播放器
    private DVDPlayer dvdPlayer;
    // 爆米花
    private Popcorn popcorn;
    // 投影仪
    private Projector projector;
    // 屏幕
    private Screen screen;
    // 音响
    private Stereo stereo;

    public HomeTheaterFacade(){
        this.dvdPlayer = DVDPlayer.getInstance();
        this.popcorn = Popcorn.getInstance();
        this.projector = Projector.getInstance();
        this.screen = Screen.getInstance();
        this.stereo = Stereo.getInstance();
    }

    public void ready(){
        popcorn.on();// 打开爆米花机子
        projector.on();// 打开投影仪
        screen.down();// 屏幕下放
        dvdPlayer.on(); // dvd打开
        stereo.on();// 音响打开

    }
    public void end(){
        popcorn.off();// 关闭爆米花机子
        projector.off();// 关闭投影仪
        screen.up();// 收起屏幕
        dvdPlayer.off(); // dvd关闭
        stereo.off();// 音响关闭
    }
    public void play(){
        dvdPlayer.play(); // 开始玩耍dvd
        stereo.setVolume(); // 设置音量
        popcorn.pop(); // 开始爆爆米花
    }
    public void pause(){
        dvdPlayer.pause(); // 暂停dvd播放器
    }

}
